<div id="user_list">
    <div class="control_nav">
        <div class="control_nav_l">
            <?php echo $student['firstname'],' ',$student['lastname']; ?>'s video(s).
        </div>
        <div class="control_nav_r">
            <a href="<?php echo site_url('admin/student/video/'.$student['id'].'/add');?>"><?php echo image_asset('icons/add.png',''); ?> <?php echo $this->lang->line('add'); ?></a>
        </div>
        <div class="clear"></div>
    </div>
    
    <table id="user_list_tb" class="list_tb datatable">
        <thead>
            <tr>
                <th class="check_alls"><input type="checkbox" /></th>
                <th class="date"><?php echo $this->lang->line('date add'); ?></th>
                <th><?php echo $this->lang->line('title'); ?> (en)</th>
                <th><?php echo $this->lang->line('title'); ?> (th)</th>
                <th id="th_video_url"><?php echo $this->lang->line('video'); ?></th>
                <th class="status"><?php echo $this->lang->line('status'); ?></th>
                <th class="action"></th>
            </tr>
        </thead>
        <tbody>
        <?php
            if(is_array($student_video_list)){
                foreach($student_video_list as $val){
                    $date = date('Y/m/d',$val['create_date']);
                    $status = $val['status']==='1'?'Active':'Deactive';
                    $title = json_decode($val['title']);
                    $video = trim($val['video_url'])!='' ? '<a href="'.$val['video_url'].'" title="video" target="_blank">'.image_asset('icons/film.png','').'</a>' : '';
                    $edit = '<a href="'.site_url('admin/student/edit/'.$val['id']).'" title="edit">'.image_asset('icons/pencil.png','').'</a>';
                    $delete = '<a href="'.site_url('admin/student/delete/'.$val['id']).'" title="delete">'.image_asset('icons/delete.png','').'</a>';
                    echo <<<EOF
                        <tr>
                            <td class="center"><input type="checkbox" name="id[]" value="{$val['id']}" /></td>
                            <td class="center">{$date}</td>
                            <td>{$title->{'en'}}</td>
                            <td>{$title->{'th'}}</td>
                            <td class="center">{$video}</td>
                            <td class="center">{$status}</td>
                            <td class="center">{$edit} {$delete}</td>
                        </tr>
EOF;
                }
            }else{
                echo '<tr><td colspan="7" class="center">' , $this->lang->line('student video empty') , '</td></tr>';
            }
        ?>
        </tbody>
    </table>
    <div class="clear"></div>
</div>